﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace CAD.Console
{
    internal class Program
    {
        static void Main(string[] args)
        {
            init();
        }

        static void init()
        {
            string dllName = "CAD.Demo.dll";
            string namespaceName = "CAD.Demo";
            string className = "HelloCommand";
            string methodName = "CadHello";

             
            var adapterFileInfo = new FileInfo(Assembly.GetExecutingAssembly().Location);
            var targetFilePath = Path.Combine(adapterFileInfo.DirectoryName, dllName);
            var targetAssembly = Assembly.Load(File.ReadAllBytes(targetFilePath));
            var targetType = targetAssembly.GetType($"{namespaceName}.{className}");
            //if (targetType == null) { MessageBox.Show("targetType==null", "error++"); return; }
            var targetMethod = targetType.GetMethod(methodName);
            var targetObject = Activator.CreateInstance(targetType);


        }


    }
}
